package ifwhilefor;

import java.util.Scanner;

public class CalQuoAndRemWiutMulAndDiv {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入被除与余的整数");
        int num1 = sc.nextInt(), temp = num1, remainder, i;
        System.out.println("请输入除与余的整数");
        int num2 = sc.nextInt();
//        for (i = 0; temp > 0; i++) {
//            temp -= num2;
//        }
//        if (temp < 0) {
//            remainder = temp + num2;
//            i--;
//        } else
//            remainder = 0;
        for (i = 0; temp >= num2; i++) {
            temp -= num2;
        }
        remainder = temp;
        System.out.println(num1 + "/" + num2 + "=" + i);
        System.out.println(num1 + "%" + num2 + "=" + remainder);
    }
}
